<?php
$criteria = new CDbCriteria(array(
    'order' => 'RAND()',
    'limit' => 5,
        ));

$results = Article::model()->findAll($criteria);
?>
<div class="list-group">
    <h4 class="headings mgt0 group-heading">Articles</h4>

    <?php
    foreach ($results as $result) {
        echo '<a href="' . Yii::app()->createUrl('articles-' . $result->id.'-'.$result->seo_title) . '" class="list-group-item">' . substr($result->title, 0, 40) . '</a>';
    }
    ?>

</div>
